﻿/*--------------------------------------------------------------------------------
 * Adaptive Intelligence - Telnet UI Application
 * Version 2.10
 * 
 * Application Utilities Class
 *      Provides shared/static methods for use throughout the namespace.
 *------------------------------------------------------------------------------*/

/*--------------------------------------------------------------------------------
 * System Imports
 *------------------------------------------------------------------------------*/
using System;
using System.Net;
using Adaptive.Foundation;
using Adaptive.Network;
using Adaptive.Network.Sockets;
using System.Drawing;
using Adaptive.Telnet.UI.Properties;

namespace Adaptive.Telnet.UI
{
    /// <summary>
    /// Provides shared/static methods for use throughout the namespace.
    /// </summary>
    public static class AppUtilities
    {
        /*--------------------------------------------------------------------------------
         * Public Methods / Functions
         *------------------------------------------------------------------------------*/
        #region Public Methods / Functions
        /// <summary>
        /// Gets the default application font instance from the current app settings.
        /// </summary>
        /// <returns>
        /// A <see cref="Font"/> instance.
        /// </returns>
        public static Font GetApplicationDefaultFont()
        {
            Settings appSettings = null;
            Font returnValue = null;
            FontStyle style = FontStyle.Regular;

            appSettings = new Settings();
            if (appSettings.DefaultFontBold)
                style |= FontStyle.Bold;
            if (appSettings.DefaultFontItalic)
                style |= FontStyle.Italic;
            if (appSettings.DefaultFontUnderline)
                style |= FontStyle.Underline;

            returnValue = new Font(appSettings.DefaultFontName, appSettings.DefaultFontSize, style);
            return returnValue;

        }
        #endregion
    }
}